<template>
  <div class="head">
    <div class="tit" @click="tab">
      <button id="1" :class="id==='1'?'active':''" class="tex1">基本户账户交易明细</button>
      <button id="2" :class="id==='2'?'active':''" class="tex1">代收货款账户交易明细</button>
      <button id="3" :class="id==='3'?'active':''" class="tex1">基金账户交易明细</button>
    </div>
    <div class="line" />
    <div class="title">查询条件</div>
    <div class="line" />
    <el-row>
      <el-col :span="24">
        <div class="title1">
          <el-form ref="form" style="display: flex;flex-wrap: wrap;margin-top: 24px;justify-content: space-between;" :model="form" label-width="80px">
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1620px;">
              <el-form-item style="margin-left: 0;" class="text" label="网点编号">
                <el-input v-model="form.name" class="input" />
              </el-form-item>
              <el-form-item class="text" label="网点名称">
                <el-select
                  v-model="mxForm.destinationProvince"
                  class="input"
                  placeholder="请选择目的省份"
                  style="width: 228px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
                <el-select
                  v-model="mxForm.destinationCity"
                  class="input"
                  placeholder="请选择目的城市"
                  style="width: 228px;margin-left: 12px;"
                >
                  <el-option
                    v-for="item in cityList"
                    :key="item.id"
                    :label="item.city"
                    :value="item.city"
                  />
                </el-select>
                <el-select
                  placeholder="请选择"
                  style="width: 228px;margin-left: 12px;"
                >
                  <el-option
                    v-for="item in cityList"
                    :key="item.id"
                    class="input"
                    :label="item.city"
                    :value="item.city"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="业务摘要">
                <el-input v-model="form.name" class="input" />

              </el-form-item>
            </div>
            <div>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
                <el-button>重置</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div class="title1">
          <el-form ref="form" style="display: flex;justify-content: space-between;flex-wrap: wrap;" :model="form" label-width="80px">
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1200px;">
              <el-form-item class="text" style="margin-left: 0;" label="交易金额">
                <el-input v-model="form.name" class="input" />
              </el-form-item>
              <div>
                <el-select
                  placeholder="请选择"
                  style="width: 132px;"
                >
                  <el-option
                    v-for="item in cityList"
                    :key="item.id"
                    class="input"
                    :label="item.city"
                    :value="item.city"
                  />
                </el-select>
                <el-date-picker
                  v-model="value"
                  type="daterange"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-time="['00:00:00', '23:59:59']"
                  style="width: 634px;margin-left: 10px;"
                />
              </div>
            </div>
            <!-- </el-form> -->
            <el-form-item class="text" style="margin-left: -65px;" label="费用科目">
              <el-select
                class="input"
                placeholder="请输入关键字后自动搜索"
                style="width: 286px;"
                @change="provinceChange"
              >
                <el-option
                  v-for="item in ProvinceList"
                  :key="item.id"
                  :label="item.province"
                  :value="{ pid: item.pid, province: item.province }"
                />
              </el-select>
            </el-form-item>
            <div>
              <el-form-item>
                <el-button @click="onSubmit"><i class="el-icon-upload2" />导出</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div class="title1">
          <el-form ref="form" style="display: flex;flex-wrap: wrap;" :model="form">
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 850px;">
              <el-form-item class="text" style="display: flex;" label="费用科目收付类型">
              <el-select
                class="input"
                placeholder="请输入关键字后自动搜索"
                style="width: 286px;"
                @change="provinceChange"
              >
                <el-option
                  v-for="item in ProvinceList"
                  :key="item.id"
                  :label="item.province"
                  :value="{ pid: item.pid, province: item.province }"
                />
              </el-select>
            </el-form-item>
            <el-form-item class="text" style="display: flex;" label="费用科目">
              <el-input v-model="form.name" class="input" />
            </el-form-item>
            </div>
          </el-form>
        </div>
        <el-table
          v-if="id==='1'"
          :data="tableData"
          border
          max-height="734"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label=""
            width="180"
            align="center"
          />
          <el-table-column
            prop="name"
            label="业务日期(会计日期)"
            width="180"
            align="center"
          />
          <el-table-column
            prop="address"
            label="记账日期"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点编号"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点名称"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="业务类型"
            sortable
          />
          <el-table-column
            prop="address"
            label="业务摘要"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="费用名称"
            sortable
          />
          <el-table-column
            prop="address"
            label="费用科目收付类型"
            align="center"
          />
          <el-table-column
            prop="address"
            label="发生额(收入)"
            sortable
            align="center"
          />
        </el-table>
        <el-table
          v-if="id==='2'"
          :data="tableData"
          border
          max-height="734"

          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label=""
            width="180"
            align="center"
          />
          <el-table-column
            prop="name"
            label="业务日期"
            sortable
            width="180"
            align="center"
          />
          <el-table-column
            prop="address"
            label="记账日期"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点编号"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点名称"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="业务类型"
            sortable
          />
          <el-table-column
            prop="address"
            label="业务摘要"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="费用名称"
            sortable
          />
          <el-table-column
            prop="address"
            label="费用科目收付类型"
            align="center"
          />
          <el-table-column
            prop="address"
            label="发生额(收入)"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="发生额(支出)"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="余额"
            align="center"
          />
        </el-table>
        <el-table
          v-if="id==='3'"
          :data="tableData"
          border
          max-height="734"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label=""
            width="180"
            align="center"
          />
          <el-table-column
            prop="name"
            label="业务日期(会计日期)"
            width="180"
            align="center"
          />
          <el-table-column
            prop="address"
            label="记账日期"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点编号"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点名称"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="业务类型"
            sortable
          />
          <el-table-column
            prop="address"
            label="业务摘要"
            align="center"
            sortable
          />
          <el-table-column
            prop="address"
            align="center"
            label="费用名称"
            sortable
          />
          <el-table-column
            prop="address"
            label="费用科目收付类型"
            align="center"
          />
          <el-table-column
            prop="address"
            label="发生额(收入)"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="发生额(支出)"
            sortable
            align="center"
          />
          <el-table-column
            prop="address"
            label="余额"
            align="center"
          />
        </el-table>
        <div style="display: flex;justify-content: space-between;margin-top: 51px;">
          <div class="title2">显示2到2，共2记录</div>
          <div class="title2">合计：29876</div>
          <div class="block" style="display: flex; justify-content: end">
            <el-pagination
              background
              :current-page="currentPage4"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="10"
              layout="prev, pager, next,sizes"
              :total="khTotal"
              prev-text="上一页"
              next-text="下一页"
              @size-change="khHandleSizeChange"
              @current-change="khHandleCurrentChange"
            />
          </div>
        </div>

      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getCityId, getProvinceList } from '@/api/dashboard'

export default {

  components: {},
  data() {
    return {
      id: '1',
      ProvinceList: [], // 省
      cityList: [], // 市
      value: '',
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      mxForm: {
        destinationProvince: '',
        destinationCity: ''
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },

  computed: {},

  created() {
    this.getProvince()
  },

  methods: {
    // tab切换
    tab(e) {
      this.id = e.target.id
    },
    // 获取省
    getProvince() {
      getProvinceList().then((res) => {
        if (res.code === 200) {
          this.ProvinceList = res.data
        }
      })
    },
    // 获取省的id
    provinceChange(value) {
      console.log(value)
      this.mxForm.destinationProvince = value.province
      this.getCity(value.pid)
    },
    getCity(pid) {
      getCityId(pid).then((res) => {
        if (res.code === 200) {
          this.cityList = res.data
        }
      })
    }
  }
}

</script>
<style  scoped lang="scss">
.tit{
  display: flex;
  .tex1{
    margin-right: 48px;
    font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
background: #fff;
border: 1px #fff solid;
  }
  .active{
    font-family: Source Han Sans CN;
font-weight: 700;
color: #2087D0;
position: relative;

  }
  .active::before{
    position: absolute;
      content: '';
      width: 142px;
height: 2px;
background: #2087D0;
border-radius: 1px;
      bottom:-20px;
      left: 50%;
      transform: translate(-50%);
  }
}
.head{
  padding: 30px;
}
.title{
  font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-top: 20px;
}
.line{
  height: 1px;
background: #D8D8D8;
border-radius: 1px;
margin-top: 19px;
}
.title1{
  // display: flex;
  // justify-content: space-between;
  .text{
    font-size: 18px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
// margin-left: 52px;
.input{
  width: 286px;
height: 36px;
background: #FFFFFF;
// border: 1px solid #B4B4B4;
border-radius: 4px;
}
.input1{
  width: 708px;
height: 36px;
background: #FFFFFF;
border: 1px solid #B4B4B4;
border-radius: 4px;
}
  }
}
.title2{
  font-size: 18px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
</style>
